$(document).ready(function (){

    var endPointOptions = {
        "url": "http://localhost:9200/GetEmployees",
        type: "GET",
        dataType: 'json',
        success: function(data,status,requestObj){

            var employeeList = data.Data.EmployeeList;

            // data --> Array of objects
            var tableDataString = '';

            for(var i= 0 ; i < employeeList.length; i++){
                tableDataString  += '<tr><td style="padding:5px">' + (i + 1) + '.'
                    + employeeList[i].name +','+ employeeList[i].title
                 +',' + employeeList[i].city + '</td></tr>'
            }


            $('#employeeDetails tbody').append(tableDataString);


        },
        error: function(requestObj,status,error){

        },
        complete: function(requestObj,status){

        }
    };

    $.ajax(endPointOptions);
});
